package com.hzhjhh.view.manageView.menus.storage;

import java.awt.Frame;
import java.awt.Rectangle;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.BorderFactory;
import javax.swing.JTable;
import javax.swing.JTextArea;

import java.util.Vector;
import javax.swing.JScrollPane;
import javax.swing.table.JTableHeader;

import com.hzhjhh.init.dialog.Mytable;
import com.hzhjhh.util.TimerScheduleTaskUtil;
import com.hzhjhh.view.manageView.menus.storage.constant.ShowConstants;
import com.hzhjhh.view.manageView.menus.storage.inReturnGoods.CancelBt;
import com.hzhjhh.view.manageView.menus.storage.inReturnGoods.DeleteBt;
import com.hzhjhh.view.manageView.menus.storage.inReturnGoods.EnsureBt;
import com.hzhjhh.view.manageView.menus.storage.inReturnGoods.MerchandiseCode;
import com.hzhjhh.view.manageView.menus.storage.inReturnGoods.QueryBt;
import com.hzhjhh.view.manageView.menus.storage.inReturnGoods.SubmitBt;
import com.hzhjhh.view.manageView.menus.storage.inReturnGoods.Time;

import lombok.Getter;
import lombok.Setter;

import javax.swing.JButton;
import java.awt.Color;
import java.awt.Font;

/**
 * 菜单栏初始化-仓库-进/退货-进/退货弹出框
 * 
 * @author 12083
 *
 */
@Getter
@Setter
public class InReturnGoodsDialog extends JDialog {
    JPanel panel1 = new JPanel();
    JLabel jLabel1 = new JLabel();
    JComboBox jComboBox1 = new JComboBox();
    JLabel lbTime = Time.lbInit();
    JTextField txfTime = Time.txfInit(this);
    JLabel jLabel3 = new JLabel();
    JComboBox jComboBox2 = new JComboBox();
    JLabel jLabel4 = new JLabel();
    JLabel jLabel6 = new JLabel();
    JTextField txfMerchandiseCode = MerchandiseCode.txfInit(this);
    JLabel jLabel7 = new JLabel();
    JTextField jTextField3 = new JTextField();
    JLabel jLabel8 = new JLabel();
    JTextField jTextField4 = new JTextField();
    JLabel jLabel9 = new JLabel();

    JTable jTable1 = new JTable();
    JTableHeader jTableHeader1 = jTable1.getTableHeader();

    Vector colnames1 = new Vector();
    Vector colnames2 = new Vector();


    JScrollPane jScrollPane1 = new JScrollPane();
    JButton btEnsure = EnsureBt.btInit(this);
    JButton btDelete = DeleteBt.btInit(this);
    JButton btCancel = CancelBt.btInit(this);
    JButton btSubmit = SubmitBt.btInit(this);
    JButton btQuery = QueryBt.btInit(this);
    JLabel jLabel5 = new JLabel();
    JScrollPane jScrollPane2 = new JScrollPane();
    JTextArea jTextArea1 = new JTextArea();


    public InReturnGoodsDialog(Frame owner, String title, boolean modal) {
        super(owner, title, modal);
        try {
            setDefaultCloseOperation(DISPOSE_ON_CLOSE);
            jbInit();
            pack();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    public InReturnGoodsDialog() {
        this(new Frame(), "JoinAndExceed", false);
        this.setSize(600, 500);
        this.setVisible(true);
		this.setTitle("进/退货表");
		this.setLocation(200, 150);
    }

    private void jbInit() throws Exception {
        panel1.setLayout(null);
        this.getContentPane().setLayout(null);
        jLabel4.setBorder(BorderFactory.createEtchedBorder());
        jLabel4.setBounds(new Rectangle(29, 7, 536, 36));
        jLabel6.setText("商品编号：");
        jLabel6.setBounds(new Rectangle(45, 50, 68, 21));
        jLabel7.setText("数量：");
        jLabel7.setBounds(new Rectangle(263, 50, 38, 21));
        jTextField3.setBounds(new Rectangle(297, 50, 68, 21));
        jLabel8.setText("进货单价：");
        jLabel8.setBounds(new Rectangle(394, 50, 68, 21));
        jTextField4.setBounds(new Rectangle(457, 50, 68, 21));
        jLabel9.setBorder(BorderFactory.createEtchedBorder());
        jLabel9.setBounds(new Rectangle(29, 42, 536, 41));
        jScrollPane1.setBounds(new Rectangle(29, 82, 536, 270));
        panel1.setBackground(Color.pink);
        this.getContentPane().setBackground(Color.pink);
        this.setForeground(Color.pink);
        jLabel5.setFont(new java.awt.Font("宋体", Font.PLAIN, 30));
        jLabel5.setText("备注：");
        jLabel5.setBounds(new Rectangle(47, 366, 96, 45));
        jScrollPane2.setBounds(new Rectangle(120, 352, 444, 70));
        this.getContentPane().add(panel1, null);
        jComboBox2.setBounds(new Rectangle(433, 14, 94, 20));
        jLabel3.setText("制单人：");
        jLabel3.setBounds(new Rectangle(380, 14, 84, 20));
        jComboBox1.setBounds(new Rectangle(79, 14, 84, 20));
//        Timer timer = new Timer();
//        timer.schedule(new RemindTask(), 0, 1000); //得到当前时间
        TimerScheduleTaskUtil.time2Show(txfTime);
        this.getContentPane().add(jComboBox2);
        this.getContentPane().add(txfTime);
        this.getContentPane().add(jComboBox1);
        this.getContentPane().add(jLabel1);
        this.getContentPane().add(lbTime);
        this.getContentPane().add(jLabel3);
        this.getContentPane().add(jLabel4);
        this.getContentPane().add(btQuery);
        this.getContentPane().add(btEnsure);
        this.getContentPane().add(btDelete);
        this.getContentPane().add(btCancel);
        this.getContentPane().add(btSubmit);
        this.getContentPane().add(txfMerchandiseCode);
        this.getContentPane().add(jLabel9);
        this.getContentPane().add(jLabel6);
        this.getContentPane().add(jLabel7);
        this.getContentPane().add(jTextField3);
        this.getContentPane().add(jLabel8);
        this.getContentPane().add(jTextField4);
        this.getContentPane().add(jScrollPane1);
        this.getContentPane().add(jScrollPane2);
        this.getContentPane().add(jLabel5);
        jScrollPane2.getViewport().add(jTextArea1);
        jScrollPane1.getViewport().add(jTable1);
        jLabel1.setText("类别：");
        jLabel1.setBounds(new Rectangle(43, 14, 84, 20));
        panel1.setBounds(new Rectangle(0, 399, 1, 1));
        jComboBox1.addItem("  进  货 ");
        jComboBox1.addItem("  退  货 ");
        jComboBox2.addItem("郭健伟");
        jComboBox2.addItem("谭震欣");
        jComboBox2.addItem("徐敏");

        colnames1.add("");
        colnames1.add("");
        colnames1.add("");
        colnames1.add("");
        colnames1.add("");
        colnames2.add(colnames1);
        jTable1 = Mytable.maketable(colnames2, ShowConstants.IN_RETURN_GOODS_HEAD_NAME); //显示内容
    }

    Vector vector1 = new Vector();

//    class RemindTask extends TimerTask {
//        public void run() {
//			txfTime.setText(GetTime.getTime());
//        }
//    }

}



